var json = {'Results Panel Name': {'en': ' Results',
  'zh': '结果'},
  'Navigation Panel Name': {'en': ' Navigation',
    'zh': '导航'},
  'Master Control Box': {'en': 'MASTER CONTROL',
    'zh': '主控'},
  'Gene Name': {'en': 'Gene Name',
    'zh': '基因名'},
  'Base(Zooming)': {'en': 'Base',
    'zh': '原来'},
  'Genemo Manual': {'en': 'Genemo Manual ',
    'zh': 'Genemo 说明书'},
  'Ref Common Name': {'en': 'spcCmnName',
    'zh': '种类通用名称'},
  'Ref Gene Name': {'en': 'spcGeneName ',
    'zh': '种类基因名'},
  'Data Selection': {'en': ' Data selection ',
    'zh': '材料选择'},
  'Tracks On/Off': {'en': 'Tracks can be turned on/off via the checkboxes below.',
    'zh': '表观遗传相似性可以被切换通过下面的复选框。'},
  'You can also': {'en': 'You can also',
    'zh': '你也可以'},
  'Choose sample type': {'en': 'Choose sample type',
    'zh': '选择标本类型'},
  'Use all encode data': {'en': 'Use all ENCODE data.',
    'zh': '使用所有得ENCODE材料'},
  'Use entire encode dataset': {'en': 'Use the entire ENCODE dataset to query similar tracks instead of the selected ones. ',
    'zh': '使用整个ENCODE数据集查询类似的表观遗传相似性代替被选择的。'},
  'Caution on using entire encode': {'en': 'Caution: the result may take significant amount of time to compute, so providing your email is highly recommended.',
    'zh': '警告:因为结果可能需要很多时间才能计算,所以推荐用户使用电子邮件。'},
  'Common tracks': {'en': 'Common tracks',
    'zh': '共同表观遗传相似性'},
  'Unique tracks': {'en': 'Unique tracks',
    'zh': '独特表观遗传相似性'},
  'Common tracks encode': {'en': ' Common tracks from ENCODE',
    'zh': '从ENCODE的共同表观遗传相似性'},
  'Track Name': {'en': 'Track Name',
    'zh': '表观遗传相似性名'},
  'Sample Type': {'en': 'Sample Type',
    'zh': '标本类型'},
  'Preview': {'en': 'Preview',
    'zh': '预习'},
  'Data': {'en': 'Data',
    'zh': '材料'},
  'Insignificant signals': {'en': ' Tracks with insignificant signals',
    'zh': '有微不足道的信号的表观遗传相似性'},
  'Insignificant human Tracks': {'en': ' tracks with insignificant human signals',
    'zh': '有微不足道的人信号的表观遗传相似性'},
  'Unique encode': {'en': 'Unique tracks from ENCODE',
    'zh': '从ENCODE的独特表观遗传相似性'},
  'Update': {'en': 'Update',
    'zh': '更新'},
  'Reset View': {'en': 'Reset View',
    'zh': '复位观点'},
  'Close': {'en': 'Close',
    'zh': '关闭'},
  'Sample List': {'en': 'Sample List',
    'zh': '样本名单'},
  'Common sample types': {'en': 'Common sample types:',
    'zh': '普通标本类型'},
  'Ref only sample types': {'en': 'Ref-only sample types',
    'zh': '独家种类的样本类型'},
  'Download Data': {'en': 'Download Data',
    'zh': '下载材料'},
  'Hint': {'en': ' Hint: tracks can be turned on / off via the <span class="panel">track selection</span> panel, click button on the left to show.',
    'zh': '暗示:表观遗传相似性可以被切换通过<span class="panel">表观遗传相似性选择</span>面板, 点击左边的按键就会出现。'},
  'Do not show': {'en': 'Do not show in the future',
    'zh': '以后别显示'},
  'Lab': {'en': 'Lab',
    'zh': '实验室'},
  'Insignificant spcCmnName Tracks': {'en': ' Tracks with insignificant signals for spcCmnName',
    'zh': '有微不足道的种类通用名称信号的表观遗传相似性'},
  'Reference': {'en': 'Reference: ',
    'zh': '参考:'},
  'Use sample': {'en': 'Use sample',
    'zh': '使用样品'},
  'Computing time': {'en': 'Some results may take a while to compute. You may provide an email here to get notification once the analysis is completed.',
    'zh': '有的结果会需要一些时间才能计算。你可以在这儿给你的电子邮件地址，计算完就会用电子邮件通知你。'},
  'Provide url': {'en': 'You may also provide a URL for a <a href="/goldenPath/help/wiggle.html">wig</a> / <a href="/goldenPath/help/bigWig.html" target="_blank">bigWig</a> file <strong><em>for display purposes only</em></strong>',
    'zh': '你也可以提供一个网址<a href="/goldenPath/help/wiggle.html">wig</a> / <a href="/goldenPath/help/bigWig.html" target="_blank">bigWig</a> file <strong><em>仅供显示</em></strong>'},
  'Search Range': {'en': 'You can also specify the range to limit the search results to a certain genome location.',
    'zh': '您还可以指定范围来限制搜索结果有一定的基因组位置。'},
  'Search': {'en': 'Search',
    'zh': '搜索'},
  'Search against': {'en': 'Please specify the reference genome you would like to search against, then upload your custom peak file below for analysis. Either put your file on a public server and provide the URL, or directly upload the file here. (<a href="/goldenPath/help/customTrack.html#BED" target="_blank">BED, peaks format</a> files are accepted either by uploading or providing URL, <a href="/goldenPath/help/bigWig.html" target="_blank">bigWig files</a> are accepted by URL only.)      ',
    'zh': '请指定参考基因组，你想搜索对抗，然后在下面上传您的自定义峰值文件进行分析。要么把你的文件在公共服务器上，并提供URL，或者直接在这里上传的文件。(<a href="/goldenPath/help/customTrack.html#BED" target="_blank">BED, peaks 格式</a> 文件上传或提供URL要么接受， <a href="/goldenPath/help/bigWig.html" target="_blank">bigWig 文件</a> 仅通过网址被接受。)      '},
  'Insignificant mouse Tracks': {'en': 'Tracks with insignificant signals for mouse',
    'zh': '与微不足道的信号，鼠标曲目'},
  'Data References': {'en': 'Data References',
    'zh': '数据引用'},
  '': {'en': 'Please refer to <a href="http://data.genomegitar.org/">http://data.genomegitar.org/</a> for description and download of all data sets used here.',
    'zh': '请参阅 <a href="http://data.genomegitar.org/">http://data.genomegitar.org/</a> 这里使用的所有数据集的描述和下载。'},
  'Ref to compare': {'en': ' Ref to compare: ',
    'zh': '物种进行比较：'},
  'Gene': {'en': 'Gene',
    'zh': '基因'},
  'Region for': {'en': 'Region for',
    'zh': '对于地'},
  'Threshold': {'en': 'Threshold (# of reads / 1Mbp)',
    'zh': '阈 （数读每一百万碱基对）'},
  'returnEmail': {'en': '(Optional) Your email address',
    'zh': '(自选) 你的电子邮件地址'},
  'urlFileToShow': {'en': '(Optional) Display file URL',
    'zh': '(自选) 显示文件的网址'},
  'searchRangeInput': {'en': '(Optional) Search range',
    'zh': '(自选) 搜索范围'},
  'regionDropdown': {'en': 'Reference',
    'zh': '参考'},
  'urlFileInput': {'en': 'URL for data file',
    'zh': '数据文件的网址'},
  'Data selection': {'en': ' Data selection ',
    'zh': '数据选择'},
  '': {'en': '',
    'zh': 'asdf'}

}
// use x[i].tagName
function setTexts (language) {
  var x = document.querySelectorAll('.text')

// var keys = Object.keys(json);
// var keys2 = Object.keys(x);

  for (i = 0; i < x.length; i++) {
    if (x[i].tagName == 'PAPER-BUTTON' || x[i].tagName == 'SPAN') {
      x[i].innerHTML = json[x[i].id][language]
    }
    if (x[i].tagName == 'PAPER-INPUT' || x[i].tagName == 'PAPER-DROPDOWN-MENU') { x[i].label = json[x[i].id][language] }

  /* for (j=0;j<keys.length;j++){
     if (x[i]==keys[j]())
       x[i].innerHTML=y[j][language];

  } */
  }
  console.log(this)
}
